<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h3>人的对象：firstName姓 name、age、fullName方法</h3>
		<h3>动态添加属性</h3>
		<script>
			var person={
				firstName:"陈",
				lastName: "强",
				age:18,
				fullName: function(){
					//函数里不能直接访问对象属性，加this关键字
				return	this.firstName+this.lastName;
				}
			}
			console.log(person);
			console.log(person.age);
			console.log(person.fullName());
			
			//动态添加
			person.address="西安";
			person.fullName2=function(){
				return person.firstName+person.lastName+" "+person.age;
			}
			console.log(person);
			console.log(person.fullName2());
		</script>
	</body>
</html>
